import {defineStore} from 'pinia'
import {ref} from 'vue'

// 定义Store
export const useMemberStore = defineStore('member',()=>{
    //会员信息
    const profile = ref()

    //保存会员信息，登录时使用
    const saveProfile = (val)=>{
        profile.value = val
    }

    //清理会员信息，退出账号时使用
    const clearProfile = ()=>{
        profile.value = undefined
    }

    //一定要记得return!!!
    return{
        profile,
        saveProfile,
        clearProfile
    },
    //TODO:持久化
    {
        persist:true
    }


})